package com.credithc.customers.base.ro;

import com.credithc.customers.base.utils.CustomerUtils;
import lombok.Data;

import java.io.Serializable;

/**
 * @author zhukai
 * @date 2018/11/28 10:55
 */
@Data
public class CustomerIdInfoRo implements Serializable {
    private String idCardType;

    private String idCardNo;

    private String customerName;

    private Boolean elementsVerified;

    private String elementsTime;

    public CustomerIdInfoRo() {

    }

    public CustomerIdInfoRo(String idCardType, String idCardNo, String customerName, Boolean elementsVerified) {
        this.idCardType = idCardType;
        this.idCardNo = idCardNo;
        this.customerName = customerName;
        this.elementsVerified = elementsVerified;
    }

    public static void checkBaseParam(CustomerIdInfoRo ro) {
        CustomerUtils.checkIdCardType(ro.getIdCardType());
        CustomerUtils.checkIdCardNo(ro.getIdCardNo());
        CustomerUtils.checkIdCardTypeAndNo(ro.getIdCardType(),ro.getIdCardNo());
        CustomerUtils.checkCustomerName(ro.getCustomerName());
        CustomerUtils.checkElementsVerified(ro.getElementsVerified());
    }
}
